home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / System / Time Server < prev    next >
Encoding:
Text File  |  1999-03-04  |  840 b   |  38 lines  |  [TEXT/ToyS]

  1. property kasTitle : "Time Server"
  2.  
  3. property kdtYYYY : 1
  4. property kdtMo : 3
  5. property kdtD : 5
  6. property kdtH : 7
  7. property kdtM : 9
  8. property kdtS : 10
  9. property kdtYYYYMMDDHMS : kdtYYYY + (16 * kdtMo) + (16 ^ 2 * kdtD) + (16 ^ 3) * kdtH + (16 ^ 4 * kdtM) + (16 ^ 5 * kdtS)
  10.  
  11. global gasWin
  12.  
  13.  
  14. on run
  15.     try
  16.         set loc to (load preference named kasTitle)
  17.     on error
  18.         set loc to {-1, -1}
  19.     end try
  20.     
  21.     set gasWin to display info titled kasTitle located at loc
  22. end run
  23.  
  24.  
  25. on quit
  26.     save preference (screen location of (display info gasWin with disposal)) named kasTitle
  27.     continue quit
  28. end quit
  29.  
  30.  
  31. on GiveMeTheTime(clientName, clientTime)
  32.     set td to the clock using format kdtYYYYMMDDHMS
  33.     display info gasWin message clientName at line 1
  34.     display info gasWin message clientTime at line 2
  35.     display info gasWin message td at line 3
  36.     return td
  37. end GiveMeTheTime
  38.